derivation of acceleration due to gravity